<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .path {
            width: 300px;
            height: 300px;
            margin: 20px auto;
            padding: 20px;
            border-radius: 50%;
            background: yellow;
        }

        .avatar {
            display: block;
            width: 50px;
            height: 50px;
            margin: 0 auto;
            border-radius: 50%;
        }

        @keyframes spin {
            to {
                transform: rotate(1turn);
            }
        }

        @keyframes spin-reverse {
            from {
                transform: rotate(1turn);
            }
        }

        .avatar {
            animation: spin 3s infinite linear;
            transform-origin: 50% 150px;
            /* 150px = 路径的半径 */
        }

        .avatar1 img {
            display: block;
            width: 50px;
            height: 50px;
            margin: 0 auto;
            border-radius: 50%;
        }

        /* .avatar1 img {
            animation: spin-reverse 3s infinite linear;
        }

        .avatar1 {
            animation: spin 3s infinite linear;
            transform-origin: 50% 150px;
            /* 150px = 路径的半径 
        } */

        .avatar1 {
            animation: spin 3s infinite linear;
            transform-origin: 50% 150px;
            /* 150px = 路径的半径 */
        }

        .avatar1>img {
            animation: inherit;
            animation-direction: reverse;
        }

        @keyframes spin1 {
            from {
                transform: rotate(0turn) translateY(-150px) translateY(50%) rotate(1turn);
            }

            to {
                transform: rotate(1turn) translateY(-150px) translateY(50%) rotate(0turn);
            }
        }

        .avatar1.a {
            /* animation: spin1 3s infinite linear; */
        }
    </style>
</head>

<body>
    <div class="content">
        <h1></h1>
        <ul>
            <li>头像的方向也跟着旋转了</li>
        </ul>
        <div class="path">
            <img src="./tou.jfif" class="avatar" />
        </div>
        <ul>
            <li>通过对头像元素设置另一个旋转动画，让它以相反的方向自传一周</li>
        </ul>
        <div class="path">
            <div class=" avatar1">
                <img src="./tou.jfif" />
            </div>
        </div>
        <div class="path">
            <div class=" avatar1 a">
                <img src="./tou.jfif" />
            </div>
        </div>
    </div>
</body>

</html>